<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html">
    <script src="${request.contextPath}/statics/js/DatePicker/WdatePicker.js"></script>
    <script src="${request.contextPath}/statics/plugins/ueditor/ueditor.config.js"></script>
    <!--<script src="${request.contextPath}/statics/plugins/ueditor/ueditor.all.js"></script>-->
    <script src="${request.contextPath}/statics/plugins/ueditor/ueditor.all.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script src="${request.contextPath}/statics/plugins/ueditor/ueditor.parse.js"></script>


    <!--<script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/locales/zh.js"></script>-->
    <script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/fileinput.min.js"></script>
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/css/fileinput.css">


</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <!--<input type="text" class="form-control" v-model="q.roleName" @keyup.enter="query" placeholder="角色名称">-->
                <select class="form-control" placeholder="请选择" v-model="q.channel" @keyup.enter="query">
                    <option disabled value="">请选择</option>
                    <option v-for="channel in channels">{{channel.name}}</option>
                </select>
            </div>
            <a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("news:topic:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("news:topic:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("news:topic:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default" >
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal" style="width:90%!important;">
            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 10%;">作者</div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="topic.author" placeholder="作者"/>
                </div>

                <div class="col-sm-2 control-label" style="width: 10%;" >公告类型</div>
                <div class="col-sm-10" style="width: 40%;" >
                    <!--<input type="text" class="form-control" width="80%" v-model="topic.cname" placeholder="公告类型"/>-->
                    <select class="form-control" placeholder="请选择" v-model="topic.cid">
                        <option disabled value="">请选择</option>
                        <option v-for="channel in channels" :key="channel.id" :value="channel.id">{{channel.name}}</option>
                        <!--<option v-for="channel in channels" :key="channel.id" :value="channel">{{channel.name}}</option>-->
                    </select>
                    <!--<span>Selected: {{ channelSelected }}</span>-->
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 10%;">标题</div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="topic.title" placeholder="标题"/>
                </div>

                <div class="col-sm-2 control-label" style="width: 10%;">发布时间</div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="date" class="form-control" width="80%" v-model="topic.publishDate" pattern="yyyy-MM-dd"/>
                    <!--<input type="text" class="form-control" width="80%" v-model="topic.publishDate" readonly onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" placeholder="发布时间"/>-->
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 10%;">发布内容</div>
                <div class="col-sm-10" style="width: 90%;">
                    <!--<input type="text/plain" class="form-control" width="80%" v-model="topic.content" placeholder=""/>-->
                    <script id="editor" type="text/plain" v-model="topic.content"></script>
                    <!-- 配置文件 -->
                    <script type="text/javascript" src="${request.contextPath}/statics/plugins/ueditor/ueditor.config.js"></script>
                    <!-- 编辑器源码文件 -->
                    <script type="text/javascript" src="${request.contextPath}/statics/plugins/ueditor/ueditor.all.min.js">></script>
                    <!-- 实例化编辑器 -->
                    <script type="text/javascript">
                        var ue = UE.getEditor('editor');
                    </script>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 10%;">手机缩略图</div>
                <div class="col-sm-10" style="width: 40%;">
                <input class="form-control" id="myFile" type="file" name="myFile" class="fileloading"/>
                <span class="help-block">显示在手机中的缩略图建议宽210px高120px</span>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 10%;">是否发布</div>
                <div class="col-sm-10" style="width: 40%;">
                    <!--<input type="text" class="form-control" width="80%" v-model="topic.status" placeholder=""/>-->
                    <select class="form-control" width="80%" v-model="topic.status" >
                        <option disabled value="">请选择</option>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            </div>

	            <!--<div class="form-group">-->
                    <!--<div class="col-sm-2 control-label" style="width: 10%;"></div>-->
                    <!--<div class="col-sm-10" style="width: 40%;">-->
                        <!--<input type="hidden" class="form-control" width="80%" v-model="topic.logo" placeholder=""/>-->
                    <!--</div>-->
                <!--</div>-->




            <div class="form-group">
            	<div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/news/topic.js?_${.now?long}"></script>
</body>

<script>

</script>
</html>